<!DOCTYPE html>
<html lang="zh-cN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScipt库</title>
    <script src="https://lib.baomitu.com/animejs/latest/anime.js"></script>
    <link rel="stylesheet" href="../css/common.css">
    <style>
        div.blue{
            width: 2rem;
            height: 2rem;
            background-color: #0502a3;
        }
    </style>
</head>
<body>
    <h1>Anime.js</h1>
    <section>
        <div class="blue"></div>
    </section>
    <script>
        anime({
                targets:"div.blue",
                translateX: "26rem",
                loop: true,
                direction: "alternate",
                duration: 1800
        })
    </script>
</body>
</html>